# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Ondrej Kucera <ondrej.kucera@centrum.cz>

pkgname=perl-xml-sax-writer
pkgver=0.57
pkgrel=2
pkgdesc="XML-SAX-Writer perl module (SAX2 writer)"
arch=("any")
url="https://search.cpan.org/dist/XML-SAX-Writer/"
license=("PerlArtistic")
depends=('perl' 'perl-text-iconv' 'perl-xml-filter-buffertext')
options=(!emptydirs)
source=(https://search.cpan.org/CPAN/authors/id/P/PE/PERIGRIN/XML-SAX-Writer-$pkgver.tar.gz)
sha256sums=('3d61d07ef43b0126f5b4de4f415a256fa859fa88dc4fdabaad70b7be7c682cf0')

build() {
  cd "$srcdir"/XML-SAX-Writer-${pkgver}
  # Install module into the vendor directories.
  perl Makefile.PL INSTALLDIRS=vendor
  make
  make test
}

package() {
  cd "$srcdir"/XML-SAX-Writer-${pkgver}
  make DESTDIR="$pkgdir" install

  # Remove .packlist and perllocal.pod files.
  find "$pkgdir" -name '.packlist' -delete
  find "$pkgdir" -name 'perllocal.pod' -delete
}
